package com.cyjt.operation.fragment;

import com.cyjt.operation.R;

import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * 显示设备状态详情的对话框
 * 
 * @author LTP
 *
 */
public class DialogFragmentForDeviceStatusDetails extends DialogFragment {
	/** 设备详情文本信息 */
	private TextView textView_detailDeviceInfo;
	private View view;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		view = inflater.inflate(R.layout.fragment_device_status_details, container);
		initView();
		return view;
	}

	/**
	 * 控件初始化
	 */
	private void initView() {
		// TODO Auto-generated method stub
		textView_detailDeviceInfo = (TextView) view.findViewById(R.id.textView_detail_device_status_info);
		// String title = getArguments().getString("title");
		// getDialog().getWindow().setTitle(title);
		String text = getArguments().getString("text");// 接收从Activity传来的设备详情文本信息
		textView_detailDeviceInfo.setText(text);
		view.findViewById(R.id.relativeLayout_detail_device_status_info).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO 点击对话框，对话框消失
				getDialog().dismiss();
			}
		});
	}
}
